/*
*使用：<input type="checkbox" class="weui-switch">
*
*/

@function _($px) {
    $rem: $px/50;
    @return #{$rem}rem;
}
.weui-switch{
    position: relative;
    width: _(104);
    height: _(64);
    border: 1px solid #DFDFDF;
    outline: 0;
    border-radius: _(32);
    box-sizing: border-box;
    background-color: #DFDFDF;
    -webkit-appearance: none;
    -webkit-transition: background-color 0.1s, border 0.1s;
    transition: background-color 0.1s, border 0.1s;
}
.weui-switch:before{
    content: " ";
    position: absolute;
    top: 0;
    left: 0;
    width: _(100);
    height: _(60);
    border-radius: _(30);
    background-color: #FDFDFD;
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
    transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1), -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
}
.weui-switch:after{
    content: " ";
    position: absolute;
    top: 0;
    left: 0;
    width: _(60);
    height: _(60);
    border-radius: _(30);
    background-color: #FFFFFF;
    box-shadow: 0 1px _(6) rgba(0, 0, 0, 0.4);
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
}
.weui-switch:checked{
    /** vux **/
    border-color: #ffe26d;
    background-color: #ffe26d;
    /** end vux **/
}
.weui-switch:checked:before{
  -webkit-transform: scale(0);
          transform: scale(0);
}
.weui-switch:checked:after{
  -webkit-transform: translateX(_(40));
          transform: translateX(_(40));
}